<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>use sg_ses | Matrix207&#39;s Blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="##1.Introduction
The sg_ses utility enables a user “to manage and sense the state of the powersupplies, cooling devices, displays, indicators, individual drives, and othernon-SCSI elements installed i">
<meta property="og:type" content="article">
<meta property="og:title" content="use sg_ses">
<meta property="og:url" content="http://yoursite.com/2013/06/20/use-sg_ses/index.html">
<meta property="og:site_name" content="Matrix207's Blog">
<meta property="og:description" content="##1.Introduction
The sg_ses utility enables a user “to manage and sense the state of the powersupplies, cooling devices, displays, indicators, individual drives, and othernon-SCSI elements installed i">
<meta property="og:updated_time" content="2016-07-17T14:33:54.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="use sg_ses">
<meta name="twitter:description" content="##1.Introduction
The sg_ses utility enables a user “to manage and sense the state of the powersupplies, cooling devices, displays, indicators, individual drives, and othernon-SCSI elements installed i">
  
    <link rel="alternate" href="/atom.xml" title="Matrix207&#39;s Blog" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
  

</head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Matrix207&#39;s Blog</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="Flux RSS"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Rechercher"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-use-sg_ses" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2013/06/20/use-sg_ses/" class="article-date">
  <time datetime="2013-06-19T16:00:00.000Z" itemprop="datePublished">2013-06-20</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/storage/">storage</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      use sg_ses
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>##1.Introduction</p>
<p>The sg_ses utility enables a user “to manage and sense the state of the power<br>supplies, cooling devices, displays, indicators, individual drives, and other<br>non-SCSI elements installed in an enclosure”.<br>The SCSI Enclosure Services standards (most recent is SES-2 ANSI INCITS 448-2008<br>) and the latest draft (ses3r03.pdf at www.t10.org) describe the format that the<br>sg_ses utility expects to find in a SES device (“logical unit” or “process”)</p>
<p>##2.Command Tools</p>
<p>sg_map - displays mapping between linux sg and other SCSI devices </p>
<p>sg_ses - send controls and fetch status from a SCSI EnclosureServices (SES) device </p>
<p>sg  = SCSI Generic<br>ses = SCSI Enclosure Service</p>
<p>##3.Use command<br>query mapping of expander and device name</p>
<pre><code>[root@ ~]# sg_map
/dev/sg0  /dev/sda
/dev/sg1  /dev/sdb
/dev/sg2  /dev/sdc
/dev/sg3  /dev/sdd
/dev/sg4  /dev/sde
/dev/sg5  /dev/sdf
/dev/sg6  /dev/sdg
/dev/sg7
/dev/sg8  /dev/sdh
/dev/sg9  /dev/sdi
/dev/sg10  /dev/sdj
/dev/sg11  /dev/sdk
/dev/sg12  /dev/sdl
/dev/sg13  /dev/sdm
/dev/sg14

[root@ ~]# sg_map -i
/dev/sg0  /dev/sda  ATA       SanDisk SSD U100  10.5
/dev/sg1  /dev/sdb  ATA       Hitachi HUA72201  A3EA
/dev/sg2  /dev/sdc  ATA       Hitachi HUA72201  A39C
/dev/sg3  /dev/sdd  ATA       ST2000VX000-9YW1  CV13
/dev/sg4  /dev/sde  ATA       Hitachi HUA72201  A3EA
/dev/sg5  /dev/sdf  ATA       ST2000VX000-9YW1  CV13
/dev/sg6  /dev/sdg  ATA       ST2000VX000-9YW1  CV13
/dev/sg7  GOOXI     Bobcat            0d00
/dev/sg8  /dev/sdh  ATA       ST2000VX000-9YW1  CV13
/dev/sg9  /dev/sdi  ATA       ST2000VX000-9YW1  CV13
/dev/sg10  /dev/sdj  ATA       ST2000VX000-9YW1  CV13
/dev/sg11  /dev/sdk  ATA       ST2000VX000-9YW1  CV13
/dev/sg12  /dev/sdl  ATA       Hitachi HDE72101  A31B
/dev/sg13  /dev/sdm  ATA       Hitachi HDE72101  A3AA
/dev/sg14  GOOXI     Bobcat            0d00
</code></pre><p>There are two expanders, /dev/sg7 and /dev/sg14, to show the only expanders<br>list, use below command:</p>
<pre><code>[root@ ~]# sg_map | awk &apos;{if($2==&quot;&quot;){print $1}}&apos;
/dev/sg7
/dev/sg14
</code></pre><p>We also can use ls to find expanders:</p>
<pre><code>[root@ ~]# ls /dev/sg* -l
crw-rw---- 1 root disk 21,  0 Jun 18 22:54 /dev/sg0
crw-rw---- 1 root disk 21,  1 Jun 19 17:33 /dev/sg1
crw-rw---- 1 root disk 21, 15 Jun 19 23:33 /dev/sg15
crw-rw---- 1 root disk 21, 16 Jun 19 23:33 /dev/sg16
crw-rw---- 1 root disk 21, 17 Jun 19 23:33 /dev/sg17
crw-rw---- 1 root disk 21, 18 Jun 19 23:33 /dev/sg18
crw-rw---- 1 root disk 21,  2 Jun 18 22:55 /dev/sg2
crw-rw---- 1 root disk 21,  3 Jun 18 22:55 /dev/sg3
crw-rw---- 1 root disk 21,  4 Jun 19 17:33 /dev/sg4
crw-rw---- 1 root disk 21,  5 Jun 18 22:55 /dev/sg5
crw-rw---- 1 root disk 21,  6 Jun 20 17:49 /dev/sg6
crw-rw---- 1 root root 21,  7 Jun 18 22:55 /dev/sg7
crw-rw---- 1 root disk 21,  8 Jun 20 21:46 /dev/sg8
crw-rw---- 1 root disk 21,  9 Jun 20 21:46 /dev/sg9

[root@ ~]# ls /dev/sg* -l |awk &apos;{if($4==&quot;root&quot;){print $10}}&apos;
/dev/sg7
</code></pre><p>To view the pages of /dev/sg7</p>
<pre><code>[root@ ~]# sg_ses -p 0 /dev/sg7
  GOOXI     Bobcat            0d00
    enclosure services device
Supported diagnostic pages:
  Supported diagnostic pages [0x0]
  Configuration (SES) [0x1]
  Enclosure status/control (SES) [0x2]
  String In/Out (SES) [0x4]
  Threshold In/Out (SES) [0x5]
  Element descriptor (SES) [0x7]
  Additional element status (SES-2) [0xa]
  Supported SES diagnostic pages (SES-2) [0xd]
  Download microcode (SES-2) [0xe]
  Subenclosure nickname (SES-2) [0xf]
</code></pre><p>To view the enclosure status </p>
<pre><code>[root@ ~]# sg_ses -p 2 /dev/sg7
  GOOXI     Bobcat            0d00
    enclosure services device
Enclosure status diagnostic page:
  INVOP=0, INFO=1, NON-CRIT=0, CRIT=0, UNRECOV=0
  generation code: 0x0
  status descriptor list
    Element type: Array device slot, subenclosure id: 0
     Overall 0 descriptor:
       Predicted failure=0, Disabled=0, Swap=0, status: Unsupported
       OK=0, Reserved device=0, Hot spare=0, Cons check=0
       In crit array=0, In failed array=0, Rebuild/remap=0, R/R abort=0
       App client bypass A=0, Do not remove=0, Enc bypass A=0, Enc bypass B=0
       Ready to insert=0, RMV=0, Ident=0, Report=0
       App client bypass B=0, Fault sensed=0, Fault reqstd=0, Device off=0
       Bypassed A=0, Bypassed B=0, Dev bypassed A=0, Dev bypassed B=0
     Element 0 descriptor:
       Predicted failure=0, Disabled=0, Swap=0, status: Not installed
       OK=0, Reserved device=0, Hot spare=0, Cons check=0
       In crit array=0, In failed array=0, Rebuild/remap=0, R/R abort=0
       App client bypass A=0, Do not remove=0, Enc bypass A=0, Enc bypass B=0
       Ready to insert=0, RMV=0, Ident=0, Report=0
       App client bypass B=0, Fault sensed=0, Fault reqstd=0, Device off=0
       Bypassed A=0, Bypassed B=0, Dev bypassed A=0, Dev bypassed B=0
     Element 1 descriptor:
       Predicted failure=0, Disabled=0, Swap=0, status: OK
       OK=0, Reserved device=0, Hot spare=0, Cons check=0
       In crit array=0, In failed array=0, Rebuild/remap=0, R/R abort=0
       App client bypass A=0, Do not remove=0, Enc bypass A=0, Enc bypass B=0
       Ready to insert=0, RMV=0, Ident=0, Report=0
       App client bypass B=0, Fault sensed=0, Fault reqstd=0, Device off=0
       Bypassed A=0, Bypassed B=0, Dev bypassed A=0, Dev bypassed B=0

     ...

     Element 27 descriptor:
       Predicted failure=0, Disabled=0, Swap=0, status: Not installed
       OK=0, Reserved device=0, Hot spare=0, Cons check=0
       In crit array=0, In failed array=0, Rebuild/remap=0, R/R abort=0
       App client bypass A=0, Do not remove=0, Enc bypass A=0, Enc bypass B=0
       Ready to insert=0, RMV=0, Ident=0, Report=0
       App client bypass B=0, Fault sensed=0, Fault reqstd=0, Device off=0
       Bypassed A=0, Bypassed B=0, Dev bypassed A=0, Dev bypassed B=0
</code></pre><p>To view the enclosure status by specify index </p>
<pre><code>[root@ ~]# sg_ses -p 2 -I 27 /dev/sg7
  GOOXI     Bobcat            0d00
    enclosure services device
Enclosure status diagnostic page:
  INVOP=0, INFO=1, NON-CRIT=0, CRIT=0, UNRECOV=0
  generation code: 0x0
  status descriptor list
     Element 27 descriptor:
       Predicted failure=0, Disabled=0, Swap=0, status: Not installed
       OK=0, Reserved device=0, Hot spare=0, Cons check=0
       In crit array=0, In failed array=0, Rebuild/remap=0, R/R abort=0
       App client bypass A=0, Do not remove=0, Enc bypass A=0, Enc bypass B=0
       Ready to insert=0, RMV=0, Ident=0, Report=0
       App client bypass B=0, Fault sensed=0, Fault reqstd=0, Device off=0
       Bypassed A=0, Bypassed B=0, Dev bypassed A=0, Dev bypassed B=0
</code></pre><p>view enclosure Additional element status<br>From result info, we can map the slot num with element index, also SAS address</p>
<pre><code>[root@ ~]# sg_ses -p 0xa /dev/sg7
  GOOXI     Bobcat            0d00
    enclosure services device
Additional element status diagnostic page:
  generation code: 0x0
  additional element status descriptor list
      Element index: 0
        Transport protocol: SAS
        number of phys: 1, not all phys: 0, device slot number: 21
        phy index: 0
          device type: no device attached
          initiator port for:
          target port for:
          attached SAS address: 0x0000000000000000
          SAS address: 0x0000000000000000
          phy identifier: 0x0
      Element index: 1
        Transport protocol: SAS
        number of phys: 1, not all phys: 0, device slot number: 20
        phy index: 0
          device type: no device attached
          initiator port for:
          target port for: SATA_device
          attached SAS address: 0x500605b0000272bf
          SAS address: 0x500605b0000272a1
          phy identifier: 0x0

      ...

      Element index: 27
        Transport protocol: SAS
        number of phys: 1, not all phys: 0, device slot number: 22
        phy index: 0
          device type: no device attached
          initiator port for:
          target port for:
          attached SAS address: 0x0000000000000000
          SAS address: 0x0000000000000000
          phy identifier: 0x0

# Also, we can show the specify index additional element status 
[root@ ~]# sg_ses -p 0xa -I 26 /dev/sg7
  GOOXI     Bobcat            0d00
    enclosure services device
Additional element status diagnostic page:
  generation code: 0x0
  additional element status descriptor list
      Element index: 26
        Transport protocol: SAS
        number of phys: 1, not all phys: 0, device slot number: 23
        phy index: 0
          device type: no device attached
          initiator port for:
          target port for: SATA_device
          attached SAS address: 0x500605b0000272bf
          SAS address: 0x500605b0000272ba
          phy identifier: 0x0
</code></pre><p>This command get a simple output:</p>
<pre><code># command explain:
# grep -E &apos;Element|slot&apos;     search by an extended regular expression 
# sed &apos;N;s/\n//&apos;             join two lines together
# awk &apos;{print $3,$15}&apos;       printf third and 15th column

# out format: element_index slot_number 
[root@ ~]# sg_ses -p 0xa /dev/sg7 |grep -E &apos;slot|Element&apos; |sed &apos;N;s/\n//&apos; |awk &apos;{print $3,$15}&apos;
0 21
1 20
2 16
3 12
4 24
5 25
6 26
7 27
8 8
9 4
10 0
11 1
12 3
13 2
14 7
15 6
16 5
17 11
18 10
19 9
20 15
21 14
22 13
23 19
24 18
25 17
26 23
27 22

# out format: slot_number element_index
[root@ ~]# sg_ses -p 0xa /dev/sg7 |grep -E &apos;slot|Element&apos; |sed &apos;N;s/\n//&apos; |awk &apos;{print $15,$3}&apos; |sort -n
0 10
1 11
2 13
3 12
4 9
5 16
6 15
7 14
8 8
9 19
10 18
11 17
12 3
13 22
14 21
15 20
16 2
17 25
18 24
19 23
20 1
21 0
22 27
23 26
24 4
25 5
26 6
27 7
</code></pre><p>we can get the mapping relation between slot number and SAS address:</p>
<pre><code># 0x0000000000000000 means there is not exist physical disk
[root@ ~]# sg_ses -p 0xa /dev/sg7 |grep -E &apos;slot|  SAS address&apos; |sed &apos;N;s/\n//&apos; |awk &apos;{print $12,$15}&apos; |sort -n
0 0x50014ee300165dde
1 0x50014ee3556bb24a
2 0x50014ee30016698a
3 0x50014ee300166666
4 0x50014ee300165dea
5 0x50014ee3aac1019e
6 0x0000000000000000
7 0x0000000000000000
8 0x0000000000000000
9 0x0000000000000000
10 0x0000000000000000
11 0x0000000000000000
12 0x0000000000000000
13 0x0000000000000000
14 0x0000000000000000
15 0x0000000000000000
16 0x500605b0000272a2
17 0x500605b0000272b9
18 0x500605b0000272b8
19 0x500605b0000272b7
20 0x500605b0000272a1
21 0x0000000000000000
22 0x0000000000000000
23 0x500605b0000272ba
24 0x500148500018fba0
25 0x500148500018fba0
26 0x0000000000000000
27 0x500148500018fba0

[root@ ~]# sg_ses -p 0xa /dev/sg7 |grep -E &apos;slot|  SAS address&apos; |sed &apos;N;s/\n//&apos; |awk &apos;{print $12,$15}&apos; |sort -n |grep -v 0x0000000000000000
0 0x50014ee300165dde
1 0x50014ee3556bb24a
2 0x50014ee30016698a
3 0x50014ee300166666
4 0x50014ee300165dea
5 0x50014ee3aac1019e
16 0x500605b0000272a2
17 0x500605b0000272b9
18 0x500605b0000272b8
19 0x500605b0000272b7
20 0x500605b0000272a1
23 0x500605b0000272ba
24 0x500148500018fba0
25 0x500148500018fba0
27 0x500148500018fba0
</code></pre><p>##4.Control LED</p>
<p>Table 72 – Array Device Slot control element<br>(Taken from <a href="http://sg.danny.cz/sg/sg_ses.html" target="_blank" rel="external">http://sg.danny.cz/sg/sg_ses.html</a>)</p>
<pre><code>+-Byte\Bit-+---7----+---6----+---5----+---4----+---3----+---2----+---1----+---0----+
+     0    +                           COMMON CONTROL                              +
+----------+--------+--------+--------+--------+--------+--------+--------+--------+
+          + RQST   + RQST   + RQST   + RQST   + RQST   +RQST IN +RQST    + RQST   +
+     1    + OK     + RSVD   + HOT    + CONS   + IN CRIT+FAILED  +REBUILD/+ R/R    +
+          +        + DEVICE + SPARE  + CHECK  + ARRAY  +ARRAY   +REMAP   + ABORT  +
+----------+--------+--------+--------+--------+--------+--------+--------+--------+
+     2    + RQST   + DO NOT +Reserved+ RQST   + RQST   + RQST   + RQST   +Reserved+
+          + ACTIVE + REMOVE +        +MISSING + INSERT + REMOVE + IDENT  +        +
+----------+--------+--------+--------+--------+--------+--------+--------+--------+
+     3    +     Reserved    + RQST   + DEVICE + ENABLE + ENABLE +     Reserved    +
+          +                 + FAULT  +  OFF   + BYP A  + BYP B  +                 +
+----------+--------+--------+--------+--------+--------+--------+--------+--------+
</code></pre><p>Insert harddisk, Blue LED light on, it is controlled by hardware.</p>
<p>Read/write harddisk, Blue LED flash, it is controlled by hardware also.</p>
<pre><code>--index   : Element index (not slot index)
--set     : set   a status of specify element
--clear   : clear a status of specify element
/dev/sg5  : expander position (There is problem, how to position which disk
            belong to which expander?)

##raid failed: (Blue LED light on, green LED flash)
sg_ses --index=27 --set=1:2:1 /dev/sg5

##rebuild: (Red LED flash)
sg_ses --index=27 --set=1:1:1 /dev/sg5

##miss:
sg_ses --index=27 --set=2:4:1 /dev/sg5

##indent: (Blue and Green LED flash)
sg_ses --index=27 --set=2:1:1 /dev/sg5

##disk fault: (Red LED light on)
sg_ses --index=27 --set=fault  /dev/sg5
or
sg_ses --index=27 --set=3:5:1  /dev/sg5

all the upon command can use --clear option to clean status.

The latter three invocations use a numerical description of the field whose 
format is &lt;start_byte&gt;:&lt;start_bit&gt;[:&lt;number_of_bits&gt;] . 
The &lt;number_of_bits&gt; defaults to 1 when it is not given.(try to understand 
it with table 72)

#clear status
sg_ses --index 27 --clear=1:1 /dev/sg5
sg_ses --index 27 --clear=1:2 /dev/sg5
sg_ses --index 27 --clear=3:5 /dev/sg5
</code></pre><p>Some problems:  </p>
<ul>
<li>How can I know what color the LED would be when the command done?</li>
<li>Is there exist one command that can clear all status? (I do not want to use the<br>clear command again and again, it is too ugly. or it is not need to do these?)</li>
</ul>
<p>##5.Other command tools</p>
<p>获取磁盘信息的命令工具:</p>
<pre><code>磁盘所包含的信息

硬件信息:型号、物理类型、序列号、温度、转速、工作速率、磁盘LU、
         磁盘端口SAS地址、厂商、固件、LED灯状态等
位置信息:Enclosure、slot
逻辑信息:运行状态(在线、空闲热备盘、重构盘)、逻辑类型(成员盘、空闲热备盘、
         空闲盘)、所属RAID组、所属卷组
SMART信息


#sg_map
显示sg设备和sd设备的映射关系

#sginfo –l
获取sg设备的信息

#sg_ses –p 0xa /dev/sg18
获取磁盘槽位号、磁盘端口SAS地址

#ll  /dev/disk/by-path
获取磁盘端口SAS地址、磁盘盘符

#sg_inq  -p  0x83  /dev/sdq
磁盘LU、磁盘端口SAS地址

#udevinfo –a –p /block/sdq
获取磁盘的信息

#udevinfo –q all –n /dev/sdq
获取磁盘的详细信息

#scsi_id  -x –g –s /block/sdq 
获取磁盘详细信息

#smartctl  -H /dev/sdb
查看磁盘健康状态

#smartctl -a  /dev/sdb
#smartctl -A /dev/sdb
查看磁盘SMART信息和温度

#smartctl -x  /dev/sdb
显示磁盘所有信息，包括SAS地址等
</code></pre><p>output status in raw format:</p>
<pre><code>[root@ ~]# sg_ses -p 0x2 /dev/sg7 -r
    00 00 00 00 00 00 00 00  05 04 00 00 01 04 00 00
    01 01 00 00 05 00 00 00  05 00 00 00 05 00 00 00
    05 00 00 00 05 00 00 00  05 00 00 00 05 00 00 00
    01 00 00 00 01 00 00 00  01 00 00 00 01 00 00 00
    05 00 00 00 05 00 00 00  05 00 00 00 05 00 00 00
    05 00 00 00 05 00 00 00  05 00 00 00 05 00 00 00
    05 00 00 00 11 00 00 00  11 00 00 00 11 00 00 00
    01 00 00 00 05 00 00 00

byte 1 to 8 is general description, element description if start from 8th byte.

From ses3r05.pdf Table 63 -- Element status code field (Page 70)
01    0k            Element is installed and no error conditions are known.
05    Not Installed Element is not installed in enclosure.
09~0F Reserved

So, the first 4 bytes start from 8th byte is 05 04 00 00, means not disk installed 
and its status is &quot;IN FAILED ARRAY&quot;.(See ses3r05.pdf page 77 Table 73)

The second 4 bytes is 01 04 00 00, means that disk is ok and status is &quot;IN FAILED ARRAY&quot;.

The third 4 bytes is 01 01 00 00, means that disk ok and &quot;R/R ABORT&quot;.

The 20th 4bytes is 11 00 00 00, means disk ok. 

Notice that the frist byte 11 is equal to 01, look at Table 63, we can see 
that element status code only depends on low 4 bits (0~3th bits for ELEMENT 
STATUS CODE, 4th bit is SWAP, 5th is DISABLED, 6th is PRDFAIL, 7th is Reserved)
</code></pre><p>look ses3r05.pdf for more details:</p>
<pre><code>Table 12 — Enclosure Status diagnostic page -- Page 30
Table 13 — Status descriptor                -- Page 32
Table 62 — Status element format            -- Page 70
Table 63 — ELEMENT STATUS CODE field        -- Page 70
Table 72 — Array Device Slot control element-- Page 76
Table 73 — Array Device Slot status element -- Page 77
</code></pre><p>##7.Reference</p>
<ul>
<li><a href="http://linux.die.net/man/8/sg_map" target="_blank" rel="external">man sg_map</a></li>
<li><a href="http://sg.danny.cz/sg/sg_ses.html" target="_blank" rel="external">_<strong>The sg_ses utility</strong>_</a></li>
<li><a href="http://rpm.pbone.net/index.php3/stat/45/idpl/9494420/numer/8/nazwa/sg_ses" target="_blank" rel="external">man sg_ses howto</a></li>
<li><a href="http://sg.danny.cz/sg/sg3_utils.html" target="_blank" rel="external">The Linux sg3_utils package</a></li>
<li><a href="http://sg.danny.cz/sg/" target="_blank" rel="external">The Linux SCSI Generic (sg) Driver</a></li>
<li><a href="https://github.com/zhurongze/notes/blob/master/hardware/使用SES协议实现磁盘定位.md" target="_blank" rel="external"><em><strong>使用SES协议实现磁盘定位</strong></em></a></li>
<li><a href="http://way4ever.com/?p=324" target="_blank" rel="external">磁盘信息管理所需要的技术</a></li>
<li><a href="http://www.t10.org/" target="_blank" rel="external">T10 technical Committee</a></li>
<li><a href="http://www.t10.org/cgi-bin/ac.pl?t=f&amp;f=ses3r05.pdf" target="_blank" rel="external">SCSI Enclosure Services - 3 (SES-3) ses3r05.pdf</a></li>
<li><a href="https://github.com/bvanassche/sg3_utils/blob/master/src/sg_ses.c" target="_blank" rel="external">sg_ses github source</a></li>
<li><a href="http://pic.dhe.ibm.com/infocenter/powersys/v3r1m5/index.jsp?topic=/p7eal/diskdriveenclosureleds.htm" target="_blank" rel="external">7031-D24 or 7031-T24 disk-drive enclosure LEDs</a></li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2013/06/20/use-sg_ses/" data-id="ciqqpe1ki005inmpv0w6wkg1j" class="article-share-link">Partager</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/storage/">storage</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2013/06/28/android-develepment/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Récent</strong>
      <div class="article-nav-title">
        
          android develepment
        
      </div>
    </a>
  
  
    <a href="/2013/06/07/iscsi-and-implementation/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Ancien</strong>
      <div class="article-nav-title">iSCSI and implementation</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Catégories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/blog/">blog</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/database/">database</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/english/">english</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/kernel/">kernel</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/language/">language</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/linux/">linux</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/math/">math</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/network/">network</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/others/">others</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/person/">person</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/program/">program</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/source/">source</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/storage/">storage</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/tools/">tools</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/windows/">windows</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Mot-clés</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/FAQ/">FAQ</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/IRC/">IRC</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Translation/">Translation</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/android/">android</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/api/">api</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/assembly/">assembly</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/awk/">awk</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/batch/">batch</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/blog/">blog</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/book/">book</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/c/">c</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/c/">c++</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/cache/">cache</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/crash/">crash</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/database/">database</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/debug/">debug</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/dot/">dot</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/driver/">driver</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/emacs/">emacs</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/exploit/">exploit</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/file-system/">file system</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/filesystem/">filesystem</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/flowchart/">flowchart</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gcc/">gcc</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/git/">git</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/google/">google</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/graphviz/">graphviz</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/">hexo</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hosts/">hosts</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/iscsi/">iscsi</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/javascript/">javascript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/job/">job</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/json/">json</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/kernel/">kernel</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/lisp/">lisp</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/lua/">lua</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/makefile/">makefile</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/malloc/">malloc</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/math/">math</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/maxima/">maxima</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/memory/">memory</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/memory-overflow/">memory overflow</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mtrace/">mtrace</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/netdisk/">netdisk</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/network/">network</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/others/">others</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/pandoc/">pandoc</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/performance/">performance</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/person/">person</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/protobuf/">protobuf</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/">python</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rsync/">rsync</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sed/">sed</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/shell/">shell</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/skype/">skype</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sms/">sms</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/source/">source</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ssh/">ssh</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/stack/">stack</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/storage/">storage</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/study/">study</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/svn/">svn</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sync/">sync</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/test/">test</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/time/">time</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/tools/">tools</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/valgrind/">valgrind</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vi/">vi</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vim/">vim</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/virtual/">virtual</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wget/">wget</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/windows/">windows</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wireshark/">wireshark</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/write/">write</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/xml/">xml</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Nuage de mot-clés</h3>
    <div class="widget tagcloud">
      <a href="/tags/FAQ/" style="font-size: 10px;">FAQ</a> <a href="/tags/IRC/" style="font-size: 10px;">IRC</a> <a href="/tags/Translation/" style="font-size: 13px;">Translation</a> <a href="/tags/android/" style="font-size: 10px;">android</a> <a href="/tags/api/" style="font-size: 10px;">api</a> <a href="/tags/assembly/" style="font-size: 10px;">assembly</a> <a href="/tags/awk/" style="font-size: 11px;">awk</a> <a href="/tags/batch/" style="font-size: 14px;">batch</a> <a href="/tags/blog/" style="font-size: 10px;">blog</a> <a href="/tags/book/" style="font-size: 10px;">book</a> <a href="/tags/c/" style="font-size: 16px;">c</a> <a href="/tags/c/" style="font-size: 19px;">c++</a> <a href="/tags/cache/" style="font-size: 10px;">cache</a> <a href="/tags/crash/" style="font-size: 10px;">crash</a> <a href="/tags/database/" style="font-size: 17px;">database</a> <a href="/tags/debug/" style="font-size: 12px;">debug</a> <a href="/tags/dot/" style="font-size: 10px;">dot</a> <a href="/tags/driver/" style="font-size: 10px;">driver</a> <a href="/tags/emacs/" style="font-size: 11px;">emacs</a> <a href="/tags/exploit/" style="font-size: 10px;">exploit</a> <a href="/tags/file-system/" style="font-size: 10px;">file system</a> <a href="/tags/filesystem/" style="font-size: 12px;">filesystem</a> <a href="/tags/flowchart/" style="font-size: 10px;">flowchart</a> <a href="/tags/gcc/" style="font-size: 10px;">gcc</a> <a href="/tags/git/" style="font-size: 12px;">git</a> <a href="/tags/google/" style="font-size: 11px;">google</a> <a href="/tags/graphviz/" style="font-size: 11px;">graphviz</a> <a href="/tags/hexo/" style="font-size: 10px;">hexo</a> <a href="/tags/hosts/" style="font-size: 10px;">hosts</a> <a href="/tags/iscsi/" style="font-size: 14px;">iscsi</a> <a href="/tags/java/" style="font-size: 10px;">java</a> <a href="/tags/javascript/" style="font-size: 10px;">javascript</a> <a href="/tags/job/" style="font-size: 10px;">job</a> <a href="/tags/json/" style="font-size: 10px;">json</a> <a href="/tags/kernel/" style="font-size: 14px;">kernel</a> <a href="/tags/linux/" style="font-size: 14px;">linux</a> <a href="/tags/lisp/" style="font-size: 10px;">lisp</a> <a href="/tags/lua/" style="font-size: 10px;">lua</a> <a href="/tags/makefile/" style="font-size: 10px;">makefile</a> <a href="/tags/malloc/" style="font-size: 10px;">malloc</a> <a href="/tags/math/" style="font-size: 11px;">math</a> <a href="/tags/maxima/" style="font-size: 10px;">maxima</a> <a href="/tags/memory/" style="font-size: 11px;">memory</a> <a href="/tags/memory-overflow/" style="font-size: 10px;">memory overflow</a> <a href="/tags/mtrace/" style="font-size: 10px;">mtrace</a> <a href="/tags/netdisk/" style="font-size: 10px;">netdisk</a> <a href="/tags/network/" style="font-size: 20px;">network</a> <a href="/tags/others/" style="font-size: 18px;">others</a> <a href="/tags/pandoc/" style="font-size: 10px;">pandoc</a> <a href="/tags/performance/" style="font-size: 16px;">performance</a> <a href="/tags/person/" style="font-size: 11px;">person</a> <a href="/tags/protobuf/" style="font-size: 11px;">protobuf</a> <a href="/tags/python/" style="font-size: 10px;">python</a> <a href="/tags/rsync/" style="font-size: 10px;">rsync</a> <a href="/tags/sed/" style="font-size: 11px;">sed</a> <a href="/tags/shell/" style="font-size: 15px;">shell</a> <a href="/tags/skype/" style="font-size: 11px;">skype</a> <a href="/tags/sms/" style="font-size: 10px;">sms</a> <a href="/tags/source/" style="font-size: 11px;">source</a> <a href="/tags/ssh/" style="font-size: 10px;">ssh</a> <a href="/tags/stack/" style="font-size: 10px;">stack</a> <a href="/tags/storage/" style="font-size: 15px;">storage</a> <a href="/tags/study/" style="font-size: 10px;">study</a> <a href="/tags/svn/" style="font-size: 11px;">svn</a> <a href="/tags/sync/" style="font-size: 10px;">sync</a> <a href="/tags/test/" style="font-size: 11px;">test</a> <a href="/tags/time/" style="font-size: 10px;">time</a> <a href="/tags/tools/" style="font-size: 16px;">tools</a> <a href="/tags/valgrind/" style="font-size: 10px;">valgrind</a> <a href="/tags/vi/" style="font-size: 10px;">vi</a> <a href="/tags/vim/" style="font-size: 14px;">vim</a> <a href="/tags/virtual/" style="font-size: 11px;">virtual</a> <a href="/tags/wget/" style="font-size: 10px;">wget</a> <a href="/tags/windows/" style="font-size: 11px;">windows</a> <a href="/tags/wireshark/" style="font-size: 10px;">wireshark</a> <a href="/tags/write/" style="font-size: 13px;">write</a> <a href="/tags/xml/" style="font-size: 10px;">xml</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/07/">July 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/04/">April 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/03/">March 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/02/">February 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/01/">January 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/11/">November 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/10/">October 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/09/">September 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/08/">August 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/07/">July 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/06/">June 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/03/">March 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/02/">February 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/01/">January 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/12/">December 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/11/">November 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/09/">September 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/08/">August 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/07/">July 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/06/">June 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/05/">May 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/04/">April 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/03/">March 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/11/">November 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/10/">October 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/09/">September 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/08/">August 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/07/">July 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/06/">June 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/05/">May 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/04/">April 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/03/">March 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/02/">February 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/01/">January 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/12/">December 2012</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/09/">September 2012</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Articles récents</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2016/07/17/how-to-implement-malloc/">如何实现一个malloc</a>
          </li>
        
          <li>
            <a href="/2016/07/17/study-grep-more/">grep工作原理</a>
          </li>
        
          <li>
            <a href="/2016/07/17/2016-04-13-malloc/">malloc</a>
          </li>
        
          <li>
            <a href="/2016/04/27/include-what-you-use/">使用IWYU整理头文件引用</a>
          </li>
        
          <li>
            <a href="/2016/04/24/understand-gcc-assembly-output/">understand gcc assembly output</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2016 Matrix207<br>
      Propulsé by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>

  </div>
</body>
</html>